<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title>学生列表</title>
        <link rel="stylesheet" href="/stylesheets/bootstrap.css">
    </head>
    <body>

        <table class="table">
            <tr>
                <th>编号</th>
                <th>姓名</th>
                <th>年龄</th>
                <th>性别</th>
                <th>班级</th>
                <th>操作</th>
            </tr>
            {% for s in students %}
            <tr>
                <td>{{loop.index}}</td>
                <td>{{s.name}}</td>
                <td>{{s.age}}</td>
                <td>{{ '男' if s.gender == 'male' else '女' }}</td>
                <td>{{s.className}}</td>
                <td>
                    <a href="/student/edit/{{s.id}}">编辑</a>
                    <a href="/student/remove/{{s.id}}">删除</a>
                </td>
            </tr>
            {% else %}
            <tr>
                <td colspan="6" align="center">
                    暂无学生数据，点击<a href="/">这里</a>可以添加学生
                </td>
            </tr>
            {% endfor %}
            {% if students %}
            <tr>
                <td colspan="6" align="center">
                    <a href="/">继续添加</a>
                </td>
            </tr>
            {% endif %}
        </table>

        

    </body>
</html>